package com.qingfeng.client.api;

import com.qingfeng.client.VO.AfterSellApplyVo;
import com.qingfeng.client.bean.Buyer;
import com.qingfeng.client.service.AfterSellService;
import com.qingfeng.util.ApiMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhangyuefei
 * @version 1.0
 * @date 2020/3/11 3:20 下午
 */
@Api(tags = "售后")
@RestController
@RequestMapping("/app/afterSell")
public class AfterSellApi extends BaseV1Api{

    @Autowired
    private AfterSellService afterSellService;

    @ApiOperation("申请退款")
    @PostMapping("/apple")
    public ApiMsg apply(@RequestBody AfterSellApplyVo afterSellApplyVo){
        Buyer buyer = getUser();
        afterSellService.apply(afterSellApplyVo,buyer.getId());
        return success();
    }



}
